// #ifdef VUE3
import App from './App.vue'
import store from './store'

import { createSSRApp } from 'vue'
import { createI18n } from 'vue-i18n'

import './uni.interceptor.js'

// 国际化开始
import en from './locale/en.json'
import zhHans from './locale/zh-Hans.json'
import zhHant from './locale/zh-Hant.json'
const messages = {
  en,
  'zh-Hans': zhHans,
  'zh-Hant': zhHant,
}
let i18nConfig = {
  locale: uni.getLocale(),
  messages,
}
const i18n = createI18n(i18nConfig)
// 国际化结束

// #ifdef WEB
import { IconFont } from '@nutui/icons-vue'
import '@nutui/icons-vue/dist/style_iconfont.css'
import { Icon } from 'vant'
// #endif

export function createApp() {
  const app = createSSRApp(App)
  app.use(i18n)
  app.use(store)
  // #ifdef WEB
  app.use(IconFont)
  app.use(Icon)
  // #endif
  return {
    app,
  }
}
// #endif
